<?php
/***************************************************************************
 * 
 * Copyright (c) 2010 , Inc. All Rights Reserved
 * $Id$:MCUtilTest.php,2010/05/20 13:53:57 
 * 
 **************************************************************************/
 
 
 
/**
 * @file MCUtilTest.php
 * @author huqingping(huqingping@)
 * @date 2010/05/20 13:53:57
 * @version 1.0 
 * @brief 
 *  
 **/

require_once 'PHPUnit/Framework/TestCase.php'; 
require_once dirname(__FILE__).'/../MCUtil.php';

class MCUtilTest extends PHPUnit_Framework_TestCase
{
	function testLoad()
	{
		$object = MCUtil::load('MCTimer');
		$this->assertTrue($object instanceof MCTimer);
		$this->assertEquals('MCTimer',get_class($object));
	}

	function testCache()
	{
		$object = MCUtil::load('MCTimer');
		$this->assertFalse(isset(MCUtil::$modules['MCTimer']));
		$object = MCUtil::load('Php');
		$this->assertTrue($object == MCUtil::$modules['Php']);
	}
	
	function testArgs(){
		$imagick=new Imagick("/home/mall/youa-php/lib/mccom/test/resource/backkom.jpg");
		$arg=array($imagick->getImageBlob(),123);
		
		$object=MCUtil::load('Image',$arg);
		echo "the result ";
		var_dump($object);
		echo "\n";
	}
}






/* vim: set ts=4 sw=4 sts=4 tw=100 noet: */
?>
